# Contributor: Simon Rupf <simon@rupf.net>
# Contributor: Philipp Glaum <p@pglaum.de>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-flask-sqlalchemy
_pkgname=flask_sqlalchemy
pkgver=3.1.1
pkgrel=0
pkgdesc="Adds SQLAlchemy support to your Flask application."
url="https://pypi.org/project/Flask-SQLAlchemy/"
arch="noarch"
license="BSD-3-Clause"
depends="py3-flask py3-greenlet py3-sqlalchemy"
makedepends="py3-gpep517 py3-flit-core"
checkdepends="py3-pytest py3-mock"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
27a93efb96bc8afe483dc32f9e9756e5972029464f4a201e8a55bf62b88f6bcd93ed7f4472ac21cb17376c87852a1d4b5f98a8ddb55d9b12c334346d5bc7e464  flask_sqlalchemy-3.1.1.tar.gz
"
